# Contributor: Adrian Siekierka <kontakt@asie.pl>
# Maintainer: Adrian Siekierka <kontakt@asie.pl>
pkgname=megazeux
pkgver=2.93
pkgrel=0
pkgdesc="Game creation system"
url="https://www.digitalmzx.com/"
# Compiling on s390x currently leads to an endianness misdetection, and thus
# a test failure.
# https://www.digitalmzx.com/forums/index.php?app=tracker&showissue=830
arch="all !s390x"
license="GPL-2.0-or-later"
makedepends="libpng-dev libvorbis-dev sdl2-dev zlib-dev"
subpackages="$pkgname-doc"
_srcprefix=mzx${pkgver/.}
source="${_srcprefix}src.tar.xz::https://www.digitalmzx.com/download.php?latest=src&ver=$pkgver"
builddir="$srcdir/$_srcprefix/"

build() {
	./config.sh \
		--platform unix \
		--prefix /usr \
		--bindir /usr/lib/megazeux \
		--libdir /usr/lib \
		--gamesdir /usr/bin

	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir/" install
}

sha512sums="
23356d28b59f8da5865f4535fec106f7b25f3330b58e5a1ec8839ebf2c2d529d30582ebf1753ba798f23047cf9a0ae3a1e598a672ef68b25649d12979b83a012  mzx293src.tar.xz
"
